﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tintuc.aspx.cs" Inherits="Admin_tintuc" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 112px;
        }
        .style2
        {
            width: 112px;
            height: 22px;
        }
        .style3
        {
            height: 22px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM [Tintuc] WHERE [id_row] = @original_id_row AND (([tieude] = @original_tieude) OR ([tieude] IS NULL AND @original_tieude IS NULL)) AND (([noidungtomtat] = @original_noidungtomtat) OR ([noidungtomtat] IS NULL AND @original_noidungtomtat IS NULL)) AND (([noidung] = @original_noidung) OR ([noidung] IS NULL AND @original_noidung IS NULL)) AND (([ngaydang] = @original_ngaydang) OR ([ngaydang] IS NULL AND @original_ngaydang IS NULL))" 
            InsertCommand="INSERT INTO [Tintuc] ([tieude], [noidungtomtat], [noidung], [ngaydang]) VALUES (@tieude, @noidungtomtat, @noidung, @ngaydang)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT * FROM [Tintuc]" 
            UpdateCommand="UPDATE [Tintuc] SET [tieude] = @tieude, [noidungtomtat] = @noidungtomtat, [noidung] = @noidung, [ngaydang] = @ngaydang WHERE [id_row] = @original_id_row AND (([tieude] = @original_tieude) OR ([tieude] IS NULL AND @original_tieude IS NULL)) AND (([noidungtomtat] = @original_noidungtomtat) OR ([noidungtomtat] IS NULL AND @original_noidungtomtat IS NULL)) AND (([noidung] = @original_noidung) OR ([noidung] IS NULL AND @original_noidung IS NULL)) AND (([ngaydang] = @original_ngaydang) OR ([ngaydang] IS NULL AND @original_ngaydang IS NULL))">
            <DeleteParameters>
                <asp:Parameter Name="original_id_row" Type="Decimal" />
                <asp:Parameter Name="original_tieude" Type="String" />
                <asp:Parameter Name="original_noidungtomtat" Type="String" />
                <asp:Parameter Name="original_noidung" Type="String" />
                <asp:Parameter Name="original_ngaydang" Type="DateTime" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="tieude" Type="String" />
                <asp:Parameter Name="noidungtomtat" Type="String" />
                <asp:Parameter Name="noidung" Type="String" />
                <asp:Parameter Name="ngaydang" Type="DateTime" />
                <asp:Parameter Name="original_id_row" Type="Decimal" />
                <asp:Parameter Name="original_tieude" Type="String" />
                <asp:Parameter Name="original_noidungtomtat" Type="String" />
                <asp:Parameter Name="original_noidung" Type="String" />
                <asp:Parameter Name="original_ngaydang" Type="DateTime" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="tieude" Type="String" />
                <asp:Parameter Name="noidungtomtat" Type="String" />
                <asp:Parameter Name="noidung" Type="String" />
                <asp:Parameter Name="ngaydang" Type="DateTime" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="id_row" DataSourceID="SqlDataSource1" Height="139px" Width="632px">
        <Columns>
            <asp:CommandField DeleteText="Xoa" EditText="Sua" ShowDeleteButton="True" 
                ShowEditButton="True" />
            <asp:BoundField DataField="id_row" HeaderText="ma" InsertVisible="False" 
                ReadOnly="True" SortExpression="id_row" />
            <asp:BoundField DataField="tieude" HeaderText="tieude" 
                SortExpression="tieude" />
            <asp:BoundField DataField="noidungtomtat" HeaderText="noidungtomtat" 
                SortExpression="noidungtomtat" />
            <asp:BoundField DataField="noidung" HeaderText="noidung" 
                SortExpression="noidung" />
            <asp:BoundField DataField="ngaydang" HeaderText="ngaydang" 
                SortExpression="ngaydang" />
        </Columns>
    </asp:GridView>
    
    </div>
    <br />
    them tin tuc<br />
    <br />
    <table style="width:100%;">
        <tr>
            <td class="style2">
                Tieu de</td>
            <td class="style3">
                <asp:TextBox ID="txttieude" runat="server" Width="283px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Noi dung tom tat</td>
            <td>
                <asp:TextBox ID="txtnoidungtomtat" runat="server" Width="283px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Noi dung</td>
            <td>
                <asp:TextBox ID="txtnoidung" runat="server" Width="283px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Ngay dang</td>
            <td>
                <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;</td>
            <td>
                <asp:Button ID="btnthem" runat="server" onclick="btnthem_Click" Text="Them" />
                <asp:Button ID="btnxoa" runat="server" onclick="btnxoa_Click" Text="Xoa" />
            </td>
        </tr>
    </table>
    <br />
    </form>
</body>
</html>
